﻿<UserControl x:Class="CodeAbility.MonitorAndCommand.Windows8Monitor.UserControls.PibrellaUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:converters="using:CodeAbility.MonitorAndCommand.Windows8Monitor.Converters"
             mc:Ignorable="d" 
             d:DesignHeight="200" d:DesignWidth="450">
    
    <UserControl.Resources>

        <converters:BooleanToOpacityConverter x:Key="BooleanToOpacity"/>
        <Style x:Key="LegendStyle" TargetType="TextBlock">
            <Setter Property="HorizontalAlignment" Value="Center"/>
            <Setter Property="VerticalAlignment" Value="Top"/>
            <Setter Property="Margin" Value="5"/>
            <Setter Property="FontSize" Value="20"/>
            <Setter Property="Foreground" Value="White"/>
        </Style>
        <Style x:Key="EllipseStyle" TargetType="Ellipse">
            <Setter Property="HorizontalAlignment" Value="Center"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="Width" Value="90"/>
            <Setter Property="Height" Value="90"/>
            <Setter Property="Margin" Value="10"/>
            <Setter Property="Stroke" Value="White"/>
            <Setter Property="StrokeThickness" Value="2"/>
        </Style>

    </UserControl.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="50"></RowDefinition>     
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="150"></ColumnDefinition>
            <ColumnDefinition Width="150"></ColumnDefinition>
            <ColumnDefinition Width="150"></ColumnDefinition>            
        </Grid.ColumnDefinitions>

        <Ellipse Grid.Row="0" Grid.Column="0"
                 Fill="Green" 
                 Style="{StaticResource EllipseStyle}"
                 Opacity="{Binding GreenLED, Converter={StaticResource BooleanToOpacity}, FallbackValue=0.10}"/>
        <TextBlock Grid.Row="1" Grid.Column="0"
                   Style="{StaticResource LegendStyle}"
                   Text="Normal"/>

        <Ellipse Grid.Row="0" Grid.Column="1"
                 Fill="Yellow" 
                 Style="{StaticResource EllipseStyle}"
                 Opacity="{Binding YellowLED, Converter={StaticResource BooleanToOpacity}, FallbackValue=0.10}"/>
        <TextBlock Grid.Row="1" Grid.Column="1"
                   Style="{StaticResource LegendStyle}"
                   Text="Warning"/>

        <Ellipse Grid.Row="0" Grid.Column="2"
                 Fill="Red" 
                 Style="{StaticResource EllipseStyle}"
                 Opacity="{Binding RedLED, Converter={StaticResource BooleanToOpacity}, FallbackValue=0.10}"/>
        <TextBlock Grid.Row="1" Grid.Column="2"
                   Style="{StaticResource LegendStyle}"
                   Text="Danger"/>
    </Grid>
</UserControl>
